abstract class Fruit{
	abstract public float getWeight();
}
class Apple extends Fruit{
	float weight;
	public float getWeight(){
		return weight;
	}
	public Apple(float x){
		weight=x;
	}
}
class Taozi extends Fruit{
	float weight;
	public float getWeight(){
		return weight;
	}
	public Taozi(float x){
		weight=x;
	}
}
class Orange extends Fruit{
	float weight;
	public float getWeight(){
		return weight;
	}
	public Orange(float x){
		weight=x;
	}
}
public class Main {
	public static void main(String[] args){
		int i;
		Fruit fruit[]=new Fruit[3];
		fruit[0]=new Apple(1);
		fruit[1]=new Taozi(2);
		fruit[2]=new Orange(3);
		for(i=0;i<3;i++)
		{
			System.out.print("重量为："+fruit[i].getWeight()+"\t");
			System.out.println("所属类名为："+fruit[i].getClass().getName());
		}
	}
}